efi: do not use runtime services table with efi=no-rs
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Wed, 20 Nov 2019 16:10:59 +0000 (17:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 Nov 2019 16:10:59 +0000 (17:10 +0100)
commit534f9e29ce28580892b3856036b5e5cd805667cc
tree3895561a00aa9bde61e8a3c9545ae1d3ec916f4e
parenta0bfdf64d9d124fcc1f7ff194e0a46a7e2a90f34
efi: do not use runtime services table with efi=no-rs

Before dfcccc6631 "efi: use directmap to access runtime services table"
all usages of efi_rs pointer were guarded by efi_rs_enter(), which
implicitly refused to operate with efi=no-rs (by checking if
efi_l4_pgtable is NULL - which is the case for efi=no-rs). The said
commit (re)moved that call as unneeded for just reading content of
efi_rs structure - to avoid unnecessary page tables switch. But it
neglected to check if efi_rs access is legal.

Fix this by adding explicit check for runtime service being enabled in
the cases that do not use efi_rs_enter().

Reported-by: Roman Shaposhnik <roman@zededa.com>
Fixes: dfcccc6631 "efi: use directmap to access runtime services table"
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/common/efi/runtime.c